﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinCourseControls
{
    public partial class FrmDateTimePicker : Form
    {
        public FrmDateTimePicker()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 后台代码获取时间值
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnGet_Click(object sender, EventArgs e)
        {
            // 不管任何格式显示，Value 都是当前日期时间 格式（如果我们改了Value）与操作系统时间格式一致 yyyy-MM - dd HH: mm: ss
                              // Text ---看到的是啥就是啥
            DateTime dt1 = dateTimePicker1.Value;
            DateTime dt2 = dateTimePicker2.Value;
            DateTime dt3 = dateTimePicker3.Value;
            DateTime dt4 = dateTimePicker4.Value;
            string strDt1 = dateTimePicker1.Text;
            string strDt2 = dateTimePicker2.Text;
            string strDt3 = dateTimePicker3.Text;
            string strDt4 = dateTimePicker4.Text;
        }
    }
}
